/*河南星辰软件科技有限公司
@copyright Copyright (c) 2010~2022 All rights reserved.
*/
package cn.javaxc.oa.action.process;
import java.io.*;
import java.util.*;
import java.sql.*;
import cn.javaxc.model.base.SQL;
import cn.javaxc.model.base.SQLList;
import cn.javaxc.model.base.SQLMap;
import cn.javaxc.model.base.SQLParam;
import cn.javaxc.model.page.BatisPage;
import cn.javaxc.mvcwork.controller.web.TreeBean;
import cn.javaxc.mvcwork.util.common.CommonUtil;
import cn.javaxc.mvcwork.util.common.MapListUtil;
import cn.javaxc.mvcwork.util.helper.FrameHelper;
import cn.javaxc.mvcwork.util.helper.TreeTableHelper;
import org.springframework.beans.factory.annotation.Autowired;
import cn.javaxc.system.action.base.BaseAction;
import cn.javaxc.process.service.ProcessDefinitionService;
import cn.javaxc.mvcwork.util.helper.ObjectHelper;
import cn.javaxc.oa.mapper.process.DefinitionMapper;
public class DefinitionAction extends BaseAction
{
    @Autowired(required=false)
	private DefinitionMapper mapper;
    /**
    */
    
    public Object list() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        SQLList<SQLMap> s_procdef=mapper.s_procdef(params,pagination);
        s_procdef.setPagedListInfo(pagination);
        result.put("s_procdef", s_procdef);
        
        return s_procdef;
    }
    /**
    */
    
    public Map remove() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        ProcessDefinitionService repositoryService=ObjectHelper.getBean(ProcessDefinitionService.class);
        repositoryService.deleteProcessDeploymentByIds(request.getParameter("jqcheck"));
        
        return result;
    }
    /**
    部署定义修改
    */
    
    public Map uploadSubmit() throws FileNotFoundException {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        ProcessDefinitionService repositoryService=ObjectHelper.getBean(ProcessDefinitionService.class);
        repositoryService.deployProcessDefinition(request);
        
        return result;
    }
}